class MapAddressModel {
  MapAddressModel({
    required this.city,
    required this.province,
    required this.district,
    required this.adcode,
    required this.formattedAddress,
    required this.address,
  });

  MapAddressModel.fromJson(dynamic json) {
    city = json['city'] ?? '';
    province = json['province'] ?? '';
    district = json['district'] ?? '';
    adcode = json['adcode'] ?? '';
    formattedAddress = json['formatted_address'] ?? '';
    address = json['address'] ?? '';
  }

  late String city;
  late String province;
  late String district;
  late String adcode;
  //显示详细信息 广东省广州市番禺区小谷围街道达达眼科青少年近视防控中心广州大学城信息枢纽楼
  late String formattedAddress;
  late String address;

  MapAddressModel copyWith({
    String? city,
    String? province,
    String? district,
    String? adcode,
    String? formattedAddress,
    String? address,
  }) =>
      MapAddressModel(
        city: city ?? this.city,
        province: province ?? this.province,
        district: district ?? this.district,
        adcode: adcode ?? this.adcode,
        formattedAddress: formattedAddress ?? this.formattedAddress,
        address: address ?? this.address,
      );

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['city'] = city;
    map['province'] = province;
    map['district'] = district;
    map['adcode'] = adcode;
    map['formatted_address'] = formattedAddress;
    map['address'] = address;
    return map;
  }
}
